package cn.edu.scau.cmi.tancuier.composite.consistent;

import java.util.ArrayList;

public abstract class ConsistentOrganization {
	private String name;
	private ConsistentOrganization parent;
	private ArrayList<ConsistentOrganization> children = new ArrayList<ConsistentOrganization>();

	public ConsistentOrganization(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public ConsistentOrganization getParent() {
		return parent;
	}
	
	public void setParent(ConsistentOrganization parent) {
		this.parent = parent;
	}
	
	public ArrayList<ConsistentOrganization> getChildren() {
		return children;
	}

	public void setChildren(ArrayList<ConsistentOrganization> children) {
		this.children = children;
	}
	
	public void addChild(ConsistentOrganization child) {
		children.add(child);
	}
	
	public void deleteChild(ConsistentOrganization child) {
		children.remove(child);
	}
	
	public abstract String display(int depth);
}
